﻿@using eCollabro.Client.Models.Workflow
@using eCollabro.Client.Models.Core
@using eCollabro.Web.Base
@model UserTasksSearchModel
@using (Html.BeginForm("UserTasks", "Workflow", FormMethod.Post, new { role = "form", id = "frmUserTasks", @class = "form-horizontal" }))
{ 
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">Search Options</div>
        <div class="panel-body">

            <div class="row">
                <div class="form-group col-md-5">
                    @Html.LabelFor(m => m.Context, new { @class = "col-md-4 control-label" })
                    <div class="col-md-8">
                        <select data-ng-model="searchCriteria.Contexts" ng-options="role.RoleName for role in activeRoles" class="form-control" id="UserRoles">
                            <option value="">- Select -</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-md-5">
                    @Html.LabelFor(m => m.AssignedTo, new { @class = "col-md-4 control-label" })
                    <div class="col-md-8">
                        @Html.TextBoxFor(m => m.AssignedTo, new { @class = "form-control", ng_model = "searchCriteria.AssignedTo" })
                    </div>
                </div>
                <div class="form-group pull-right" style="padding-right:30px">
                    @Html.CheckBoxFor(m => m.ActiveTasks, new { ng_model = "searchCriteria.ActiveTasks" })
                    @Html.LabelFor(m => m.ActiveTasks)
                </div>
            </div>
            <div class="row">
                <div class="form-group col-md-5">
                    @Html.LabelFor(m => m.FromDate, new { @class = "col-md-4 control-label" })
                    <div class="col-md-8">
                        @Html.TextBoxFor(m => m.FromDate, new { @class = "form-control datepicker", ng_model = "searchCriteria.FromDate" })
                        @Html.ValidationMessageFor(m => m.FromDate)
                    </div>
                </div>
                <div class="form-group col-md-5">
                    @Html.LabelFor(m => m.ToDate, new { @class = "col-md-4 control-label" })
                    <div class="col-md-8">
                        @Html.TextBoxFor(m => m.ToDate, new { @class = "form-control datepicker", ng_model = "searchCriteria.ToDate" })
                        @Html.ValidationMessageFor(m => m.ToDate)
                    </div>
                </div>
                <div class="pull-right" style="padding-right:5px">
                    <button type="button" class="btn btn-danger" ng-click="clear()"><span class="glyphicon glyphicon-remove-circle"></span> Clear</button>
                    <button type="button" class="btn btn-success" ng-click="loadUserTasks()"><span class="glyphicon glyphicon-search"></span> Search</button>
                </div>
            </div>
        </div>
    </div>
}
